{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "270d8bf4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "71562e02",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4    0\n",
       "3    1\n",
       "2    2\n",
       "1    3\n",
       "0    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series(np.arange(5),index= np.arange(5)[::-1],dtype='int64')\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d8a73699",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4    False\n",
       "3     True\n",
       "2    False\n",
       "1     True\n",
       "0     True\n",
       "dtype: bool"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.isin([1,3,4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "aaebb616",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0  a    0\n",
       "   b    1\n",
       "   c    2\n",
       "1  a    3\n",
       "   b    4\n",
       "   c    5\n",
       "dtype: int32"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2 =  pd.Series(np.arange(6),index = pd.MultiIndex.from_product([[0,1],['a','b','c']]))\n",
    "s2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "ced40f00",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1  a    3\n",
       "dtype: int32"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2.iloc[s2.index.isin([(1,'a'),(2,'b')])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "6812db87",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4    0\n",
       "3    1\n",
       "2    2\n",
       "1    3\n",
       "0    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "78b4a2e5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    3\n",
       "0    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[s>2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "194e4bf3",
   "metadata": {},
   "outputs": [],
   "source": [
    "dates = pd.date_range('20250413',periods=8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "2e82e9d8",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(np.random.randn(8,4),index=dates,columns=['A','B','C','D'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "2e3a22c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-04-13</th>\n",
       "      <td>0.497040</td>\n",
       "      <td>-0.016290</td>\n",
       "      <td>0.938577</td>\n",
       "      <td>-1.639030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-14</th>\n",
       "      <td>1.915534</td>\n",
       "      <td>-0.340021</td>\n",
       "      <td>0.149216</td>\n",
       "      <td>-1.333998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-15</th>\n",
       "      <td>1.109463</td>\n",
       "      <td>0.440412</td>\n",
       "      <td>0.241699</td>\n",
       "      <td>0.561011</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-16</th>\n",
       "      <td>0.463119</td>\n",
       "      <td>-1.478762</td>\n",
       "      <td>-0.435357</td>\n",
       "      <td>0.025317</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-17</th>\n",
       "      <td>0.932876</td>\n",
       "      <td>0.370118</td>\n",
       "      <td>2.192610</td>\n",
       "      <td>-1.190072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-18</th>\n",
       "      <td>0.886703</td>\n",
       "      <td>-0.067731</td>\n",
       "      <td>0.009503</td>\n",
       "      <td>-1.409453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-19</th>\n",
       "      <td>-0.115122</td>\n",
       "      <td>1.719789</td>\n",
       "      <td>-1.994871</td>\n",
       "      <td>-0.621710</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-20</th>\n",
       "      <td>1.555462</td>\n",
       "      <td>-1.893382</td>\n",
       "      <td>-0.385826</td>\n",
       "      <td>1.146471</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2025-04-13  0.497040 -0.016290  0.938577 -1.639030\n",
       "2025-04-14  1.915534 -0.340021  0.149216 -1.333998\n",
       "2025-04-15  1.109463  0.440412  0.241699  0.561011\n",
       "2025-04-16  0.463119 -1.478762 -0.435357  0.025317\n",
       "2025-04-17  0.932876  0.370118  2.192610 -1.190072\n",
       "2025-04-18  0.886703 -0.067731  0.009503 -1.409453\n",
       "2025-04-19 -0.115122  1.719789 -1.994871 -0.621710\n",
       "2025-04-20  1.555462 -1.893382 -0.385826  1.146471"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "ecb2b902",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-04-13</th>\n",
       "      <td>0.497040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-14</th>\n",
       "      <td>1.915534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-15</th>\n",
       "      <td>1.109463</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-16</th>\n",
       "      <td>0.463119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-17</th>\n",
       "      <td>0.932876</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-18</th>\n",
       "      <td>0.886703</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-19</th>\n",
       "      <td>-0.115122</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-20</th>\n",
       "      <td>1.555462</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A\n",
       "2025-04-13  0.497040\n",
       "2025-04-14  1.915534\n",
       "2025-04-15  1.109463\n",
       "2025-04-16  0.463119\n",
       "2025-04-17  0.932876\n",
       "2025-04-18  0.886703\n",
       "2025-04-19 -0.115122\n",
       "2025-04-20  1.555462"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[:, df.columns == 'A']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "34eb7cc1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-04-13</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.016290</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.639030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-14</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.340021</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.333998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-15</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-16</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.478762</td>\n",
       "      <td>-0.435357</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-17</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.190072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-18</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.067731</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.409453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-19</th>\n",
       "      <td>-0.115122</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.994871</td>\n",
       "      <td>-0.621710</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-20</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.893382</td>\n",
       "      <td>-0.385826</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2025-04-13       NaN -0.016290       NaN -1.639030\n",
       "2025-04-14       NaN -0.340021       NaN -1.333998\n",
       "2025-04-15       NaN       NaN       NaN       NaN\n",
       "2025-04-16       NaN -1.478762 -0.435357       NaN\n",
       "2025-04-17       NaN       NaN       NaN -1.190072\n",
       "2025-04-18       NaN -0.067731       NaN -1.409453\n",
       "2025-04-19 -0.115122       NaN -1.994871 -0.621710\n",
       "2025-04-20       NaN -1.893382 -0.385826       NaN"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.where(df <0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "b61bce56",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-04-13</th>\n",
       "      <td>-0.497040</td>\n",
       "      <td>-0.016290</td>\n",
       "      <td>-0.938577</td>\n",
       "      <td>-1.639030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-14</th>\n",
       "      <td>-1.915534</td>\n",
       "      <td>-0.340021</td>\n",
       "      <td>-0.149216</td>\n",
       "      <td>-1.333998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-15</th>\n",
       "      <td>-1.109463</td>\n",
       "      <td>-0.440412</td>\n",
       "      <td>-0.241699</td>\n",
       "      <td>-0.561011</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-16</th>\n",
       "      <td>-0.463119</td>\n",
       "      <td>-1.478762</td>\n",
       "      <td>-0.435357</td>\n",
       "      <td>-0.025317</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-17</th>\n",
       "      <td>-0.932876</td>\n",
       "      <td>-0.370118</td>\n",
       "      <td>-2.192610</td>\n",
       "      <td>-1.190072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-18</th>\n",
       "      <td>-0.886703</td>\n",
       "      <td>-0.067731</td>\n",
       "      <td>-0.009503</td>\n",
       "      <td>-1.409453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-19</th>\n",
       "      <td>-0.115122</td>\n",
       "      <td>-1.719789</td>\n",
       "      <td>-1.994871</td>\n",
       "      <td>-0.621710</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-04-20</th>\n",
       "      <td>-1.555462</td>\n",
       "      <td>-1.893382</td>\n",
       "      <td>-0.385826</td>\n",
       "      <td>-1.146471</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2025-04-13 -0.497040 -0.016290 -0.938577 -1.639030\n",
       "2025-04-14 -1.915534 -0.340021 -0.149216 -1.333998\n",
       "2025-04-15 -1.109463 -0.440412 -0.241699 -0.561011\n",
       "2025-04-16 -0.463119 -1.478762 -0.435357 -0.025317\n",
       "2025-04-17 -0.932876 -0.370118 -2.192610 -1.190072\n",
       "2025-04-18 -0.886703 -0.067731 -0.009503 -1.409453\n",
       "2025-04-19 -0.115122 -1.719789 -1.994871 -0.621710\n",
       "2025-04-20 -1.555462 -1.893382 -0.385826 -1.146471"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.where(df <0,-df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "e4410dff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.516314</td>\n",
       "      <td>0.014458</td>\n",
       "      <td>0.684658</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.441280</td>\n",
       "      <td>0.274456</td>\n",
       "      <td>0.413318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.820511</td>\n",
       "      <td>0.371495</td>\n",
       "      <td>0.250638</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.931820</td>\n",
       "      <td>0.262787</td>\n",
       "      <td>0.374898</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.842381</td>\n",
       "      <td>0.666233</td>\n",
       "      <td>0.000113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.365916</td>\n",
       "      <td>0.554764</td>\n",
       "      <td>0.376999</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.367182</td>\n",
       "      <td>0.830898</td>\n",
       "      <td>0.906893</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.612389</td>\n",
       "      <td>0.758154</td>\n",
       "      <td>0.007568</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.798238</td>\n",
       "      <td>0.664250</td>\n",
       "      <td>0.822789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.595793</td>\n",
       "      <td>0.444892</td>\n",
       "      <td>0.974677</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          a         b         c\n",
       "0  0.516314  0.014458  0.684658\n",
       "1  0.441280  0.274456  0.413318\n",
       "2  0.820511  0.371495  0.250638\n",
       "3  0.931820  0.262787  0.374898\n",
       "4  0.842381  0.666233  0.000113\n",
       "5  0.365916  0.554764  0.376999\n",
       "6  0.367182  0.830898  0.906893\n",
       "7  0.612389  0.758154  0.007568\n",
       "8  0.798238  0.664250  0.822789\n",
       "9  0.595793  0.444892  0.974677"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(np.random.rand(10,3),columns=list('abc'))\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "08217164",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.365916</td>\n",
       "      <td>0.554764</td>\n",
       "      <td>0.376999</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.367182</td>\n",
       "      <td>0.830898</td>\n",
       "      <td>0.906893</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.612389</td>\n",
       "      <td>0.758154</td>\n",
       "      <td>0.007568</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          a         b         c\n",
       "5  0.365916  0.554764  0.376999\n",
       "6  0.367182  0.830898  0.906893\n",
       "7  0.612389  0.758154  0.007568"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.query('(a<b)')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "f98c9514",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.367182</td>\n",
       "      <td>0.830898</td>\n",
       "      <td>0.906893</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          a         b         c\n",
       "6  0.367182  0.830898  0.906893"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.query('(a<b) & (b<c)')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "61eae6a9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
